package com.binhthuan.catechist.client.form;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.smartgwt.client.data.DSResponse;

public interface IForm {
    public interface UpdateSuccessHandler extends EventHandler {
        void onSuccess();
    }

    public interface UpdateFailureHandler extends EventHandler {
        void onFailure(DSResponse response, Object rawData);
    }

    /**
     * Add a handler that will be called when update data success
     * 
     * @param handler
     * @return HandlerRegistration
     */
    HandlerRegistration addUpdateSuccessHandler(UpdateSuccessHandler handler);

    /**
     * Add a handler that will be called when update data failure
     * 
     * @param handler
     * @return HandlerRegistration
     */
    HandlerRegistration addUpdateFailureHandler(UpdateFailureHandler handler);
}
